#!/bin/sh
 
SEMS=`ipcs -s | awk '{printf " %d", $2}' | sed -e 's/ 0//g'`
for SEM_IDS in $SEMS
do 
	echo "ipcrm -s $SEM_IDS"
	ipcrm -s $SEM_IDS 
done
 
MSGS=`ipcs -q | awk '{printf " %d", $2}' | sed -e 's/ 0//g'`
for MSG_IDS in $MSGS
do
	echo "ipcrm -q $MSG_IDS"
	ipcrm -q $MSG_IDS
done

SHMS=`ipcs -m | awk '{printf " %d", $2}' | sed -e 's/ 0//g'`
for SHM_IDS in $SHMS
do
	echo "ipcrm -m $SHM_IDS"
	ipcrm -m $SHM_IDS 
done
